#! /bin/bash
cd linux-work
#create linux kernel source copy
echo cp linux kernel source to linux-work 
./cpkernelsrc.sh
#compile kernel
echo building linux kernel
./build.sh

cd rootfs
#copy etc sysroot's lib  to rootfs , mkdir proc sys tmp
echo prepare rootfs base 
./prep-rootfs.sh

cd ../../busybox/
echo prepare busybox source
./prep-busyboxsrc.sh
#compile busybox and install in linux-work/rootfs/rootfs
cd busybox-1.35.0
echo building busybox
./build.sh

cd ../../linux-work/aqemu
#create virtual sd
echo create virtual sd card
./createdsk.sh
#cp zImage dtb to current dir
echo cp kernel zImage to exec dir
./cp-kernel.sh  
#cp rootfs to virtual sd card
echo cp rootfs to virtual sd card
./cp-rootfs.sh  
echo  run linux 5.10.168 at qemu
./run-nolcd.sh
